package com.ruoyi.system.service.impl;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ruoyi.system.domain.UpdateStatusRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TMiStockMapper;
import com.ruoyi.system.domain.TMiStock;
import com.ruoyi.system.service.ITMiStockService;

/**
 * 库存Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-04
 */
@Service
public class TMiStockServiceImpl implements ITMiStockService
{
    @Autowired
    private TMiStockMapper tMiStockMapper;

    /**
     * 查询库存
     *
     * @param stockId 库存主键
     * @return 库存
     */
    @Override
    public TMiStock selectTMiStockByStockId(String stockId)
    {
        return tMiStockMapper.selectTMiStockByStockId(stockId);
    }

    /**
     * 查询库存列表
     *
     * @param tMiStock 库存
     * @return 库存
     */
    @Override
    public List<TMiStock> selectTMiStockList(TMiStock tMiStock)
    {

        return tMiStockMapper.selectTMiStockList(tMiStock);
    }

    /**
     * 新增库存
     *
     * @param tMiStock 库存
     * @return 结果
     */
    @Override
    public int insertTMiStock(TMiStock tMiStock)
    {
        return tMiStockMapper.insertTMiStock(tMiStock);
    }

    /**
     * 修改库存
     *
     * @param tMiStock 库存
     * @return 结果
     */
    @Override
    public int updateTMiStock(TMiStock tMiStock)
    {
        return tMiStockMapper.updateTMiStock(tMiStock);
    }

    /**
     * 批量删除库存
     *
     * @param stockIds 需要删除的库存主键
     * @return 结果
     */
    @Override
    public int deleteTMiStockByStockIds(String[] stockIds)
    {
        return tMiStockMapper.deleteTMiStockByStockIds(stockIds);
    }

    /**
     * 删除库存信息
     *
     * @param stockId 库存主键
     * @return 结果
     */
    @Override
    public int deleteTMiStockByStockId(String stockId)
    {
        return tMiStockMapper.deleteTMiStockByStockId(stockId);
    }

    @Override
    public List<TMiStock> selectTMiStocksByLocationId(String locationId) {

        return tMiStockMapper.selectTMiStocksByLocationId(locationId);
    }

    @Override
    public int updateStatus(UpdateStatusRequest request) {
        return tMiStockMapper.updateStatus(request);
    }


}
